<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Todo List</title>
  <link rel="stylesheet" href="css/base.css">
  <link rel="stylesheet" href="css/index.css">
</head>

<body>
  <section class="todoapp" id="todoapp">
    <header class="header">
      <h1>todos</h1>
      <input v-model="newItem" @keyup.enter="addItem" id="task" class="new-todo" placeholder="What needs to be done?" autofocus>
    </header>
    <!-- This section should be hidden by default and shown when there are todos -->
    <section class="main">
      <input class="toggle-all" type="checkbox">
      <label for="toggle-all">Mark all as complete</label>
      <ul class="todo-list" id="todo-list">
        
        <li :class="{completed:item.completed,editing:item._id == editId}" v-for="(item,index) in tasks" :key="index">
          <div class="view">
            <input class="toggle" type="checkbox" v-model="item.completed" @change="toggleStatus(item._id,index)">
            <label @dblclick="editItm(item._id)">{{item.title}}</label>
            <button class="destroy" @click="removeItem(item._id,index)"></button>
          </div>
          <input class="edit" v-focus @blur="saveItem(item._id,index)" v-model="item.title">
        </li>
        
      </ul>
    </section>
    <!-- This footer should hidden by default and shown when there are todos -->
    <footer class="footer">
      <!-- This should be `0 items left` by default -->
      <span class="todo-count"><strong>{{total}}</strong> item left</span>
      <!-- Remove this if you don't implement routing -->
      <ul class="filters">
        <li>
          <a class="selected" href="#/">All</a>
        </li>
        <li>
          <a href="#/active">Active</a>
        </li>
        <li>
          <a href="#/completed">Completed</a>
        </li>
      </ul>
      <!-- Hidden if no completed items are left ↓ -->
      <button class="clear-completed">Clear completed</button>
    </footer>
  </section>
  <script src="../js/vue.js"></script>
  <script src="../js/axios.js"></script>
  <script src="index.js"></script>
</body>

</html>